import java.awt.Dimension;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;


public class Search extends JFrame {
	
	private Toolkit toolkit;
	
	public Search() {
		
		setTitle ("Search");
		setSize (600, 400);
		
		toolkit = getToolkit();
		Dimension size = toolkit.getScreenSize();
		setLocation((size.width - getWidth())/2, (size.height - getHeight())/2);
		setDefaultCloseOperation (EXIT_ON_CLOSE);
		
		JPanel panel = new JPanel();
		getContentPane().add(panel);
		
		panel.setLayout(null);
		
		JButton s = new JButton("Search");
		s.setBounds (10, 10, 80, 30);
		s.addActionListener (new ActionListener() {
			public void actionPerformed(ActionEvent event) {
				setVisible(false);
			}
		});
		
		JTextField jTextField1 = new JTextField();
		jTextField1.setBounds (100, 10, 450, 30);
	    jTextField1.addActionListener(new java.awt.event.ActionListener() {
	      public void actionPerformed(ActionEvent e) {
	        System.out.println("action");
	      }
	    });
		
		panel.add (s);
		panel.add (jTextField1);
	}
	
	public static void main (String[] args) {
		
		Search buttons = new Search();
		buttons.setVisible(true);
	}
}